home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 April / Disc 2 / PCUSER0402D2.iso / software / utils / files / wincron.exe / data1.cab / Sample_Scripts / mail_basic_test.tg < prev    next >
Encoding:
Text File  |  2001-10-20  |  1.0 KB  |  33 lines

  1. ## mail_basic_test.tg
  2. # Ask the mail service to send a message for you.
  3. # This script logs into MAPI using the profile 
  4. # This scrip assumes:
  5. # 1. EMAIL_PROFILE has been set. Usually set in Config.tg
  6. # 2. A MAPI email client installed (e.g. Outlook)
  7. # 3. This script is running in an accout that has a MAPI profile.
  8. #    (NOT running in the LocalSystem account. See the documentation on running Proxy
  9. #    services at http://www.tomasello.com/software/wincron/system_service.htm)
  10.  
  11. # send an email
  12. {
  13.     -name mail_basic_test
  14.     -start 
  15.     -stop
  16.     -action -onerror operation_fail
  17.     -action -print logon to email. This may take a moment...
  18.     -action -mail Logon myHandle "%EMAIL_PROFILE%"
  19.     -action -print sending an email
  20.     -action -mail SendMail test@wincron.com "the subject" "the body"
  21.     -action -print logoff from email
  22.     -action -mail Logoff myHandle
  23.     -action -print done!
  24. }
  25.  
  26. # operation failed
  27. {
  28.     -name operation_fail
  29.     -action -print mail failed with error:
  30.     -action -print %TG.LAST_ERROR%
  31.     -action -return abort
  32. }
  33.